package com.investment.advisor.repository;

import com.investment.advisor.entity.Trade;
import com.investment.advisor.entity.Portfolio;
import com.investment.advisor.entity.Fund;
import org.springframework.data.jpa.repository.JpaRepository;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

public interface TradeRepository extends JpaRepository<Trade, Long> {
    List<Trade> findByPortfolio(Portfolio portfolio);
    
    List<Trade> findByFund(Fund fund);
    
    List<Trade> findByPortfolioAndFund(Portfolio portfolio, Fund fund);
    
    List<Trade> findByAction(String action);
    
    List<Trade> findByStatus(String status);
    
    List<Trade> findByCreator(String creator);
    
    List<Trade> findByTradeDateBetween(LocalDate startDate, LocalDate endDate);
    
    List<Trade> findByPortfolioAndTradeDateBetween(Portfolio portfolio, LocalDate startDate, LocalDate endDate);
} 